package com.cmcc.aregister.ui.adapter;
import java.util.List;
import java.util.Map;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.cmcc.aregister.R;
public class ChoiceTiptypeAdapter extends BaseAdapter {
	private Context context = null;
	public List<Map<Integer, String>> list = null;
	public ChoiceTiptypeAdapter(Context context, List<Map<Integer, String>> list) {
		this.context = context;
        this.list=list;
	}
	public Object getItem(int position) {
		return position;
	}

	public long getItemId(int position) {
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(context).inflate(
					R.layout.a_choice_tiptype, null);
			holder.name = (TextView) convertView.findViewById(R.id.name);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		Map<Integer, String> map=list.get(position);
		holder.name.setText(map.get(position+1));
		return convertView;
	}

	static class ViewHolder {
		TextView name;
	}

	@Override
	public int getCount() {
		return list.size();
	}
}